package com.jh.fcsm.beans.sys;

import com.jh.fcsm.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * 日志记录表
 *
 * @author szx
 * @date 2020-07-13 14:18:12
 */
@Table(name = "SYS_LOG_RECORD")
@ApiModel(value = "com.jh.fcsm.beans.sys.SysLogRecord", description = "日志记录表")
public class SysLogRecord extends BaseEntity {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    @Column(name = "FLAG")
    @ColumnType(jdbcType = JdbcType.INTEGER)
    @ApiModelProperty(value = "是否成功(1成功，0失败)")
    private Integer flag;

    @Column(name = "REMARK")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "备注信息")
    private String remark;

    @Column(name = "PARAMS")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "方法参数")
    private String params;

    @Column(name = "USE_TIMES")
    @ColumnType(jdbcType = JdbcType.BIGINT)
    @ApiModelProperty(value = "耗时")
    private Long useTimes;

    @Column(name = "MODULE_TYPE")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "模块类型")
    private String moduleType;

    @Column(name = "MODULE")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "模块名称")
    private String module;

    @Column(name = "USER_NAME")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "用户名")
    private String userName;

    @Column(name = "USER_ID")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "用户ID")
    private String userId;

    @Column(name = "IP")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "IP地址")
    private String ip;

    /**
     * GET 是否成功(1成功，0失败)
     *
     * @return flag
     */
    public Integer getFlag() {
        return flag;
    }

    /**
     * SET 是否成功(1成功，0失败)
     *
     * @param flag
     */
    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    /**
     * GET 备注信息
     *
     * @return remark
     */
    public String getRemark() {
        return remark;
    }

    /**
     * SET 备注信息
     *
     * @param remark
     */
    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    /**
     * GET 方法参数
     *
     * @return params
     */
    public String getParams() {
        return params;
    }

    /**
     * SET 方法参数
     *
     * @param params
     */
    public void setParams(String params) {
        this.params = params == null ? null : params.trim();
    }

    /**
     * GET 耗时
     *
     * @return useTimes
     */
    public Long getUseTimes() {
        return useTimes;
    }

    /**
     * SET 耗时
     *
     * @param useTimes
     */
    public void setUseTimes(Long useTimes) {
        this.useTimes = useTimes;
    }

    /**
     * GET 模块类型
     *
     * @return moduleType
     */
    public String getModuleType() {
        return moduleType;
    }

    /**
     * SET 模块类型
     *
     * @param moduleType
     */
    public void setModuleType(String moduleType) {
        this.moduleType = moduleType == null ? null : moduleType.trim();
    }

    /**
     * GET 模块名称
     *
     * @return module
     */
    public String getModule() {
        return module;
    }

    /**
     * SET 模块名称
     *
     * @param module
     */
    public void setModule(String module) {
        this.module = module == null ? null : module.trim();
    }

    /**
     * GET 用户名
     *
     * @return userName
     */
    public String getUserName() {
        return userName;
    }

    /**
     * SET 用户名
     *
     * @param userName
     */
    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    /**
     * GET 用户ID
     *
     * @return userId
     */
    public String getUserId() {
        return userId;
    }

    /**
     * SET 用户ID
     *
     * @param userId
     */
    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    /**
     * GET IP地址
     *
     * @return ip
     */
    public String getIp() {
        return ip;
    }

    /**
     * SET IP地址
     *
     * @param ip
     */
    public void setIp(String ip) {
        this.ip = ip == null ? null : ip.trim();
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }
}